<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content=
    "application/xhtml+xml; charset=utf-8" />
    <title>
      6.30.&nbsp;Flex-2.6.3
    </title>
    <link rel="stylesheet" type="text/css" href="../stylesheets/lfs.css" />
    <meta name="generator" content="DocBook XSL Stylesheets V1.78.1" />
    <link rel="stylesheet" href="../stylesheets/lfs-print.css" type=
    "text/css" media="print" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  </head>
  <body class="lfs" id="lfs-8.0">
    <div class="navheader">
      <h4>
        Linux From Scratch - Version 8.0
      </h4>
      <h3>
        第六章&nbsp;安装基本系统软件
      </h3>
      <ul>
        <li class="prev">
          <a accesskey="p" href="bison.html" title="Bison-3.0.4">上一页</a>
          <p>
            Bison-3.0.4
          </p>
        </li>
        <li class="next">
          <a accesskey="n" href="grep.html" title="Grep-3.0">下一页</a>
          <p>
            Grep-3.0
          </p>
        </li>
        <li class="up">
          <a accesskey="u" href="chapter06.html" title=
          "第六章&nbsp;安装基本系统软件">返回</a>
        </li>
        <li class="home">
          <a accesskey="h" href="../index.html" title=
          "Linux From Scratch - Version 8.0 ">主页</a>
        </li>
      </ul>
    </div>
    <div class="wrap" lang="en" xml:lang="en">
      <h1 class="sect1">
        <a id="ch-system-flex" name="ch-system-flex"></a>6.30. Flex-2.6.3
      </h1>
      <div class="package" lang="en" xml:lang="en">
        <p>
          Flex 软件包包含了一个可生成程序的工具，用于识别文本中的模式(pattern)。
        </p>
        <div class="segmentedlist">
          <div class="seglistitem">
            <div class="seg">
              <strong class="segtitle">预计构建时间:</strong>
              <span class="segbody">0.4 SBU</span>
            </div>
            <div class="seg">
              <strong class="segtitle">所需磁盘空间:</strong>
              <span class="segbody">32 MB</span>
            </div>
          </div>
        </div>
      </div>
      <div class="installation" lang="en" xml:lang="en">
        <h2 class="sect2">
          6.30.1. 安装 Flex
        </h2>
        <p>
          构建过程假定 <span class=
          "application">help2man</span> 程序可用，它可从执行命令的 --help 选项输出中生成帮助页面。然而该程序并不存在，所以我们使用一个环境变量来跳过这个过程。现在，准备编译 Flex:
        </p>
        <pre class="userinput">
<kbd class="command">HELP2MAN=/tools/bin/true \
./configure --prefix=/usr --docdir=/usr/share/doc/flex-2.6.3</kbd>
</pre>
        <p>
          编译该软件包:
        </p>
        <pre class="userinput">
<kbd class="command">make</kbd>
</pre>
        <p>
          如需测试 (约 0.5 SBU), 运行:
        </p>
        <pre class="userinput">
<kbd class="command">make check</kbd>
</pre>
        <p>
          已知其中一个测试 <span class="emphasis"><em>cxx_restart</em></span>会失败.
        </p>
        <p>
          安装该软件包:
        </p>
        <pre class="userinput">
<kbd class="command">make install</kbd>
</pre>
        <p>
          一些程序并不知道 <span class=
          "command"><strong>flex</strong></span> 并且试图运行其前身 <span class="command"><strong>lex</strong></span>. 为了支持这些程序, 创建一个名为<code class=
          "filename">lex</code> 的符号链接，实际上是运行了 flex 的 <span class="command"><strong>lex</strong></span> 仿真模式:
        </p>
        <pre class="userinput">
<kbd class="command">ln -sv flex /usr/bin/lex</kbd>
</pre>
      </div>
      <div class="content" lang="en" xml:lang="en">
        <h2 class="sect2">
          <a id="contents-flex" name="contents-flex"></a>6.30.2. Flex 的内容
        </h2>
        <div class="segmentedlist">
          <div class="seglistitem">
            <div class="seg">
              <strong class="segtitle">安装的程序:</strong>
              <span class="segbody">flex, flex++ (link to flex), and lex
              (link to flex)</span>
            </div>
            <div class="seg">
              <strong class="segtitle">安装的库:</strong>
              <span class="segbody">libfl.so and libfl_pic.so</span>
            </div>
            <div class="seg">
              <strong class="segtitle">安装的路径:</strong>
              <span class="segbody">/usr/share/doc/flex-2.6.3</span>
            </div>
          </div>
        </div>
        <div class="variablelist">
          <h3>
            简要描述
          </h3>
          <table border="0" class="variablelist">
            <colgroup>
              <col align="left" valign="top" />
              <col />
            </colgroup>
            <tbody>
              <tr>
                <td>
                  <p>
                    <a id="flex" name="flex"></a><span class=
                    "term"><span class=
                    "command"><strong>flex</strong></span></span>
                  </p>
                </td>
                <td>
                  <p>
                    一个用来生成一些程序的工具，这些程序用于识别文本中的模式; 它考虑到了功能的多用途性，可指定模式发现的规则，也就无需为此再开发特定的程序。
                  </p>
                </td>
              </tr>
              <tr>
                <td>
                  <p>
                    <a id="flexpp" name="flexpp"></a><span class=
                    "term"><span class=
                    "command"><strong>flex++</strong></span></span>
                  </p>
                </td>
                <td>
                  <p>
                    一个 flex 拓展功能，用来生成 C++ 代码和类，是<span class=
                    "command"><strong>flex</strong></span>的符号链接
                  </p>
                </td>
              </tr>
              <tr>
                <td>
                  <p>
                    <a id="lex" name="lex"></a><span class=
                    "term"><span class="command"><strong>lex</strong></span></span>
                  </p>
                </td>
                <td>
                  <p>
                    一个令<span class=
                    "command"><strong>flex</strong></span> 以 <span class=
                    "command"><strong>lex</strong></span> 仿真模式运行的脚本。
                  </p>
                </td>
              </tr>
              <tr>
                <td>
                  <p>
                    <a id="libfl" name="libfl"></a><span class=
                    "term"><code class="filename">libfl</code></span>
                  </p>
                </td>
                <td>
                  <p>
                     <code class="filename">flex</code> 类库
                  </p>
                </td>
              </tr>
            </tbody>
          </table>
        </div>
      </div>
    </div>
    <div class="navfooter">
      <ul>
        <li class="prev">
          <a accesskey="p" href="bison.html" title="Bison-3.0.4">上一页</a>
          <p>
            Bison-3.0.4
          </p>
        </li>
        <li class="next">
          <a accesskey="n" href="grep.html" title="Grep-3.0">下一页</a>
          <p>
            Grep-3.0
          </p>
        </li>
        <li class="up">
          <a accesskey="u" href="chapter06.html" title=
          "第六章&nbsp;安装基本系统软件">返回</a>
        </li>
        <li class="home">
          <a accesskey="h" href="../index.html" title=
          "Linux From Scratch - Version 8.0 ">主页</a>
        </li>
      </ul>
    </div>
  </body>
</html>
